#include "tinyexpr.h"
#include <stdio.h>

int main() {
    printf("Testing operator priority:\n\n");
    
    /* Test logical NOT priority */
    printf("!5 && 3 = %f (expected: 0.0)\n", te_interp("!5 && 3", 0));
    printf("!(5 && 3) = %f (expected: 1.0)\n", te_interp("!(5 && 3)", 0));
    printf("!0 || 0 = %f (expected: 1.0)\n", te_interp("!0 || 0", 0));
    printf("!5 + 3 = %f (expected: 3.0)\n", te_interp("!5 + 3", 0));
    printf("!(5 + 3) = %f (expected: 0.0)\n", te_interp("!(5 + 3)", 0));
    
    /* Test complex expressions with proper priority */
    printf("\nComplex priority tests:\n");
    printf("5 & 3 | 2 = %f (expected: 3.0)\n", te_interp("5 & 3 | 2", 0));
    
    return 0;
}